<template>
  <div v-show='isTeacherLableStatus'>
    <a-card title='基础信息'>
      <j-form-container :disabled='formDisabled' style='cursor: text'>
        <a-form-model ref='form' :model='model' slot='detail'>
          <a-row>
            <a-col :span='6'>
              <a-form-model-item label='教职工号' prop='teacherFacultyCode'>
                <a-input v-model='model.teacherFacultyCode' placeholder='请输入教职工号'></a-input>
              </a-form-model-item>
            </a-col>
            <a-col :span='6'>
              <a-form-model-item label='姓名' prop='teacherName'>
                <a-input v-model='model.teacherName' placeholder='请输入姓名'></a-input>
              </a-form-model-item>
            </a-col>
            <a-col :span='6'>
              <a-form-model-item label='电话号码' prop='teacherTel'>
                <a-input v-model='model.teacherTel' placeholder='请输入电话号码'></a-input>
              </a-form-model-item>
            </a-col>
            <a-col :span='6'>
              <a-form-model-item label='出生日期' prop='teacherBirth'>
                <j-date placeholder='请选择出生日期' v-model='model.teacherBirth' style='width: 100%' />
              </a-form-model-item>
            </a-col>
            <a-col :span='6'>
              <a-form-model-item label='性别' prop='teacherGender'>
                <j-dict-select-tag v-model='model.teacherGender' style='width: 150px' placeholder='请输入用户性别'
                                   dictCode='sex' />
              </a-form-model-item>
            </a-col>
            <a-col :span='6'>
              <a-form-model-item label='身份证号码' prop='teacherIdNumber'>
                <a-input v-model='model.teacherIdNumber' placeholder='请输入身份证号码'></a-input>
              </a-form-model-item>
            </a-col>
            <a-col :span='6'>
              <a-form-model-item label='邮箱地址' prop='teacherEmail'>
                <a-input v-model='model.teacherEmail' placeholder='请输入邮箱地址'></a-input>
              </a-form-model-item>
            </a-col>
            <a-col :span='6'>
              <a-form-model-item label='微信号' prop='teacherWechatId'>
                <a-input v-model='model.teacherWechatId' placeholder='请输入微信号'></a-input>
              </a-form-model-item>
            </a-col>
            <a-col :span='6'>
              <a-form-model-item label='QQ' prop='teacherQqId'>
                <a-input v-model='model.teacherQqId' placeholder='请输入QQ'></a-input>
              </a-form-model-item>
            </a-col>
            <a-col :span='6'>
              <a-form-model-item label='户籍' prop='teacherRegistered'>
                <a-input v-model='model.teacherRegistered' placeholder='请输入户籍'></a-input>
              </a-form-model-item>
            </a-col>
            <a-col :span='6'>
              <a-form-model-item label='家庭住址' prop='teacherAddress'>
                <a-input v-model='model.teacherAddress' placeholder='请输入家庭住址'></a-input>
              </a-form-model-item>
            </a-col>
            <a-col :span='6'>
              <a-form-model-item label='描述' prop='teacherIntroduce'>
                <a-input v-model='model.teacherIntroduce' placeholder='请输入描述'></a-input>
              </a-form-model-item>
            </a-col>
            <a-col :span='6'>
              <a-form-model-item label='职称' prop='teacherTitle'>
                <a-input v-model='model.teacherTitle' placeholder='请输入职称'></a-input>
              </a-form-model-item>
            </a-col>
            <a-col :span='6'>
              <a-form-model-item label='毕业院校' prop='teacherUniversity'>
                <a-input v-model='model.teacherUniversity' placeholder='请输入毕业院校'></a-input>
              </a-form-model-item>
            </a-col>
            <a-col :span='6'>
              <a-form-model-item label='最高学历' prop='teacherDegree'>
                <a-input v-model='model.teacherDegree' placeholder='请输入最高学历'></a-input>
              </a-form-model-item>
            </a-col>
            <a-col :span='6'>
              <a-form-model-item label='教师资格证编号' prop='teacherCertificateCode'>
                <a-input v-model='model.teacherCertificateCode' placeholder='请输入教师资格证编号'></a-input>
              </a-form-model-item>
            </a-col>
            <a-col :span='6'>
              <a-form-model-item label='银行卡号' prop='teacherBankId'>
                <a-input v-model='model.teacherBankId' placeholder='请输入银行卡号'></a-input>
              </a-form-model-item>
            </a-col>
            <a-col :span='6'>
              <a-form-model-item label='状态' prop='teacherStatus'>
                <j-dict-select-tag v-model='model.teacherStatus' style='width: 150px' placeholder='请选择状态'
                                   dictCode='teacher_status' />
              </a-form-model-item>
            </a-col>
            <a-col :span='6'>
              <a-form-model-item label='类型' prop='teacherTtype'>
                <!--              <a-input-number v-model="model.teacherTtype" placeholder="请输入类型" style="width: 100%" />-->
                <j-dict-select-tag v-model='model.teacherTtype' style='width: 150px' placeholder='请选择状态'
                                   dictCode='teacher_ttype' />
              </a-form-model-item>
            </a-col>
            <!--          <a-col :span="6">-->
            <!--            <a-form-model-item label="是否删除"  prop="teacherIzDelete">-->
            <!--              <a-input-number v-model="model.teacherIzDelete" placeholder="请输入是否删除：0：未删除；1：删除" style="width: 100%" />-->
            <!--            </a-form-model-item>-->
            <!--          </a-col>-->
            <!--          <a-col :span="6">-->
            <!--            <a-form-model-item label="学校编码（租户id）"  prop="tenantId">-->
            <!--              <a-input v-model="model.tenantId" placeholder="请输入学校编码（租户id）"  ></a-input>-->
            <!--            </a-form-model-item>-->
            <!--          </a-col>-->
            <a-col :span='6'>
              <a-form-model-item label='民族' prop='teacherNation'>
                <!--              <a-input-number v-model="model.teacherNation" placeholder="请输入民族" style="width: 100%" />-->
                <j-dict-select-tag v-model='model.teacherNation' style='width: 150px' placeholder='请选择民族'
                                   dictCode='common_nation' />
              </a-form-model-item>
            </a-col>
          </a-row>
        </a-form-model>
      </j-form-container>
    </a-card>
    <a-card
        style='width: 100%'
        title='扩展信息'
        :tab-list='tabList'
        :active-tab-key='key'
        @tabChange="key => onTabChange(key, 'key')"
    >
      <RelTeacherSubjectListComp :isRelTeacherSubjectListCompShow='isRelTeacherSubjectListCompShow'
                                 :teacherId='teacherId'></RelTeacherSubjectListComp>
      <CouTeachingJobExecuteDateListComp
          :isCouTeachingJobExecuteDateListCompShow='isCouTeachingJobExecuteDateListCompShow'
          :teacherId='teacherId'></CouTeachingJobExecuteDateListComp>
      <CouCourseArrangeConflictDetectionComp
          :isCouCourseArrangeConflictDetectionCompShow='isCouCourseArrangeConflictDetectionCompShow'
          :teacherId='teacherId'></CouCourseArrangeConflictDetectionComp>
      <CouTeachingJobExecuteListComp :isCouTeachingJobExecuteListCompShow='isCouTeachingJobExecuteListCompShow'
                                     :teacherId='teacherId'></CouTeachingJobExecuteListComp>
      <RelClassSubjectTeacherListComp :isRelClassSubjectTeacherListCompShow='isRelClassSubjectTeacherListCompShow'
                                     :teacherId='teacherId'></RelClassSubjectTeacherListComp>
      <AchClassAchievementExamScoreListylvComp :isAchClassAchievementExamScoreListylvCompShow='isAchClassAchievementExamScoreListylvCompShow'></AchClassAchievementExamScoreListylvComp>
      <AchClassAchievementExamScoreListComp :isAchClassAchievementExamScoreListCompShow='isAchClassAchievementExamScoreListCompShow'></AchClassAchievementExamScoreListComp>
      <AchClassSubjectScoreListComp :isAchClassSubjectScoreListCompShow='isAchClassSubjectScoreListCompShow'></AchClassSubjectScoreListComp>
      <AchClassSubjectProjScoreListComp :isAchClassSubjectProjScoreListCompShow='isAchClassSubjectProjScoreListCompShow'></AchClassSubjectProjScoreListComp>
    </a-card>
  </div>
</template>

<script>

import { httpAction, getAction } from '@/api/manage'
import { validateDuplicateValue } from '@/utils/util'
import RelTeacherSubjectListComp from '@views/smart_school/relation/rel_teacher_subject/RelTeacherSubjectListComp'
import CouTeachingJobExecuteDateListComp
  from '@views/smart_school/couteachingjobexecute/CouTeachingJobExecuteDateListComp'
import CouCourseArrangeConflictDetectionComp
  from '@views/smart_school/coursearrangePreview/CouCourseArrangeConflictDetectionComp'
import CouTeachingJobExecuteListComp from '@views/smart_school/couteachingjobexecute/CouTeachingJobExecuteListComp'
import RelClassSubjectTeacherListComp
  from '@views/smart_school/relation/rel_cls_tea_sub_room/RelClassSubjectTeacherListComp'
import AchClassAchievementExamScoreListylvComp
  from '@views/analysis/analysisachievement/achclasses/AchClassAchievementExamScoreListylvComp'
import AchClassAchievementExamScoreListComp
  from '@views/analysis/analysisachievement/achclasses/AchClassAchievementExamScoreListComp'
import AchClassSubjectScoreListComp from '@views/analysis/analysisachievement/achclasses/AchClassSubjectScoreListComp'
import AchClassSubjectProjScoreListComp
  from '@views/analysis/analysisachievement/achclasses/AchClassSubjectProjScoreListComp'

export default {
  name: 'TeaTeacherLable',
  components: {
    RelTeacherSubjectListComp,
    CouTeachingJobExecuteDateListComp,
    CouCourseArrangeConflictDetectionComp,
    CouTeachingJobExecuteListComp,
    RelClassSubjectTeacherListComp,
    AchClassAchievementExamScoreListylvComp,
    AchClassAchievementExamScoreListComp,
    AchClassSubjectScoreListComp,
    AchClassSubjectProjScoreListComp
  },
  props: {
    isTeacherLableStatus: {
      type: Boolean,
      default: false,
      required: false
    },
    teacherVo: {
      type: Object,
      default: false
    }
  },
  watch: {
    teacherVo: {
      immediate: true,
      handler() {
        Object.assign(this.model, this.teacherVo)
        this.teacherId = this.model.id
        this.checkValueKeyIsShow(this.key)
      }
    }
  },
  data() {
    return {
      disableMixinCreated : true, //默认初始状态不加载数据
      model: {},
      formDisabled: true,
      url: {
        queryById: '/teacher/teaTeacher/queryById'
      },
      teacherId: '',
      tabList: [
        {
          key: 'RelTeacherSubjectList',
          tab: '教学科目'
        },
        {
          key: 'CouTeachingJobExecuteDateList',
          tab: '课时统计'
        },
        {
          key: 'CouCourseArrangeConflictDetection',
          tab: '课程冲突检测'
        },
        {
          key: 'CouTeachingJobExecuteList',
          tab: '课程执行计划'
        },
        {
          key: 'RelClassSubjectTeacherList',
          tab: '班级科目教室分配'
        },
        {
          key: 'AchClassAchievementExamScoreListylv',
          tab: '各班总成绩优良率'
        },
        {
          key: 'AchClassAchievementExamScoreList',
          tab: '各班总成绩优良人数'
        },
        {
          key: 'AchClassSubjectScoreList',
          tab: '班级各科目成绩分析'
        },
        {
          key: 'AchClassSubjectProjScoreList',
          tab: '班级题型优良率分析'
        },
      ],
      key: 'RelTeacherSubjectList',
      isRelTeacherSubjectListCompShow: false,
      isCouTeachingJobExecuteDateListCompShow: false,
      isCouCourseArrangeConflictDetectionCompShow: false,
      isCouTeachingJobExecuteListCompShow: false,
      isRelClassSubjectTeacherListCompShow: false,
      isAchClassAchievementExamScoreListylvCompShow: false,
      isAchClassAchievementExamScoreListCompShow: false,
      isAchClassSubjectScoreListCompShow: false,
      isAchClassSubjectProjScoreListCompShow: false,
    }
  },
  computed: {},
  created() {
    this.clearValue()
  },
  mounted() {

  },
  methods: {
    onTabChange(value, type) {
      this.key = value
      this.checkValueKeyIsShow(this.key)

    },
    checkValueKeyIsShow(key) {
      this.isRelTeacherSubjectListCompShow = false
      this.isCouTeachingJobExecuteDateListCompShow = false
      this.isCouCourseArrangeConflictDetectionCompShow = false
      this.isCouTeachingJobExecuteListCompShow = false
      this.isRelClassSubjectTeacherListCompShow = false
      this.isAchClassAchievementExamScoreListylvCompShow = false
      this.isAchClassAchievementExamScoreListCompShow = false
      this.isAchClassSubjectScoreListCompShow = false
      this.isAchClassSubjectProjScoreListCompShow = false

      this.isCouTeachingJobExecuteDateListCompShow = false
      if (key == 'RelTeacherSubjectList') {

        this.isRelTeacherSubjectListCompShow = true

      } else if (key == 'CouTeachingJobExecuteDateList') {

        this.isCouTeachingJobExecuteDateListCompShow = true

      } else if (key == 'CouCourseArrangeConflictDetection') {
        this.isCouCourseArrangeConflictDetectionCompShow = true

      } else if (key == 'CouTeachingJobExecuteList') {
        this.isCouTeachingJobExecuteListCompShow = true

      } else if (key == 'RelClassSubjectTeacherList') {
        this.isRelClassSubjectTeacherListCompShow = true

      } else if (key == 'AchClassAchievementExamScoreListylv') {
        this.isAchClassAchievementExamScoreListylvCompShow = true

      } else if (key == 'AchClassAchievementExamScoreList') {
        this.isAchClassAchievementExamScoreListCompShow = true

      } else if (key == 'AchClassSubjectScoreList') {
        this.isAchClassSubjectScoreListCompShow = true

      } else if (key == 'AchClassSubjectProjScoreList') {
        this.isAchClassSubjectProjScoreListCompShow = true
      }
    },
    clearValue() {
      this.model = {}
      this.teacherId = ''
    }
  }
}
</script>